﻿using System;

class MaxIncreasingSequence
{
    static void Main()
    {
        int[] array = { 7, 11, -2, 3, 4, 2, 6, 1, 3, 3, 4, 4 };
        int length = 0;
        int startIndex = 0;
        int tempLength = 0;
        int nextElement = int.MaxValue;

        for (int i = 0; i < array.Length; i++)
        {
            if (array[i] > nextElement)
            {
                tempLength++;
            }
            else
            {
                if (tempLength > length)
                {
                    length = tempLength;
                    startIndex = i - length;
                }

                tempLength = 1;
            }

            nextElement = array[i];
        }

        // Last check
        if (tempLength > length)
        {
            length = tempLength;
            startIndex = array.Length - length;
        }

        // Printing the maximal sequence
        Console.Write("The maximal sequence of increasing elements is: { ");

        for (int i = startIndex; i < startIndex + length - 1; i++)
        {
            Console.Write("{0}, ", array[i]);
        }

        Console.WriteLine(array[startIndex + length - 1] + " }");
    }
}
